/*
 * Copyright (C) 2013 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

@import "base/environment";
@import "pages/agenda/agenda_view_minical";

/*.ic-app-main-content__secondary {
  @include breakpoint(desktop) {
    flex: 0 0 $ic-sp*24;
  }
}*/

#right-side {

  .element_toggler {
    padding: 0;
    @include fontSize(14px);
    line-height: 1.3;
    font-weight: bold;

    i {
      vertical-align: middle;
    }
  }
}

.agenda-wrapper {
  background-color: #fff;
  display: none;
  &.active {
    display: block;
  }

  .agenda-container {
    background: none;
    border: none;
    padding: 0;
  }
}

.agenda-day {
  display: block;
  border-bottom: 1px solid $ic-border-light;
  margin-top: $ic-sp*2;
  padding: $ic-sp/2;

  &.agenda-today {
    background: $ic-color-medium-light;
  }

  .agenda-date {
    @include fontSize(14px);
    margin: 0;
    padding-left: $ic-sp - 2;
  }
}
.agenda-event__list {
  margin: 0;
  padding: 0;
}
.agenda-event__item {
  list-style: none;
}
.agenda-event__item-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: $ic-sp;

  &:hover, &:focus {
    box-shadow: inset 3px 0 0 $ic-brand-primary;
  }
}

.agenda-event__item-container .agenda-event__icon {
  background: none;
  flex: 0 0 2rem;
  padding-left: $ic-sp/4;

  &:hover, &:focus {
    background: none;
  }
}
.agenda-event__time {
  flex: 0 0 7.875rem;
  font-weight: 300;
}

.agenda-event__item-container .agenda-event__title {
  background: none;
  font-weight: 500;
  flex: 1;

  &:hover, &:focus {
    background: none;
  }
}

.agenda-event__action {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 6.25rem;
}

span.agendaView--no-assignments {
  display: block;
  margin-top: $ic-sp*2;
  font-weight: normal;
  @include fontSize(14px);
}

.agenda-actions {
  margin-left: 10%;
  .agenda-load-btn {
    margin-bottom: 20px;
  }
}

#calendar_header {
  .navigation_buttons {
    bottom: 0;
    margin-left: 6px;
    .ui-button {
      padding: 8px;
      i:before {
        @include fontSize(12px);
      }
    }
  }

  .ui-buttonset .ui-button {
    vertical-align: middle;
  }

  .navigation_title, .appointment_group_title {
    vertical-align: middle;
    padding-left: $ic-sp/4;
  }

  #refresh_calendar_link {
    display: none;
    float: none;
    margin-right: 8px;
    &.loading {
      display: inline-block;
      cursor: default;
    }
  }
}

// Restore some missing drag styles from fullcalendar css
/*#calendar-drag-and-drop-container .fc-event {
  border-width: 1px;
  border-radius: 3px;
}*/

#calendar-app,#calendar-drag-and-drop-container {
  .fc-view-container {
    background: none;
  }

  .fc-agendaWeek-view {
    .fc-body {
      background-color: white;
    }

    .fc-divider {
      padding-bottom: 0;
    }

    .fc-widget-header, .fc-axis {
      box-sizing: border-box;
      background: none;
      border-left: none;
      color: $ic-font-color--subdued;
    }

    .fc-slats table td {
      height: 27px;
    }

    .fc-axis span {
      border-color: $ic-border-light;
      padding: 3px 6px;
    }

    .fc-axis td, span {
      background: none;
    }

    .fc-head {
      height: 32px;
    }

    .fc-widget-header {
      border-top: none;
      border-right: none;
      text-transform: uppercase;

      .fc-axis {
        border-bottom: none;
      }
    }
    .fc-day-grid .fc-today {
      background-color: transparent;
      box-shadow: .5px -6px 0px 0px $ic-brand-primary;
      border: 3px solid $ic-border-light;
    }
    // this is to hide the border-right that is being added inline within the all-day row
    .fc-day-grid .fc-row {
      border-right-color: $ic-color-light;
    }
    .fc-time-grid  .fc-today {
      background-color: transparent;
      border: 3px solid $ic-border-light;
    }

    .fc-event {
      white-space: nowrap;
      background-color: $ic-color-light;
    }

    .calendar-nowline {
      background-color: #FACE90;
      position: absolute;
      right: 0;
      height: 2px;
    }
  }

  .fc-month-view {
    .fc-widget-header {
      background: none;
      text-transform: uppercase;
      border-left: none;
      border-right: none;
    }

    .fc-body {
      background-color: white;
    }

    .fc-today {
      background: $ic-color-medium-light;
      @if $use_high_contrast {
        font-weight: bold;
        text-decoration: underline;
      }
    }
  }

  .fc-other-month {
    background: none;
  }

  .fc-event {
    background-color: $ic-color-light;
    line-height: 1.3;
    padding: $ic-sp/4;
    i {
      margin-right: 2px;
    }
  }

  .fc-grid .fc-day-number {
    padding: 1px 4px;
  }

  .loading-spinner {
    display: inline-block;
    background-image: url("/images/ajax-loader-black-on-white.gif");
    background-position: 50% 50%;
    height: 16px;
    margin-left: 3px;
    position: relative;
    top: 8px;
    width: 16px;
  }
}

.rs-section {
  border: none;
  padding: 0;
  margin: 0 0 $ic-sp*2;
  &:last-of-type { margin-bottom: 0; }
}

#context-list-holder, #undated-events {
  background-color: #fff;
  max-height: 300px;
  overflow-y: auto;

  ul {
    margin-bottom: 10px;
    &:last-of-type { margin-bottom: 0; }
  }
}

#context-list {
  padding: 0;
  max-height: none;
  .context_list_context {
    padding: 1px $ic-sp/2;
  }
  .context-list-toggle-box {
    border-radius: 2px;
    margin-left: 0;
  }
  label {
    display: inline;
    @include fontSize(13px);
    font-weight: bold;
  }
  .checked label {
    @include fontSize(13px);
    font-weight: bold;
  }
}

#calendar-toggle-button,
#undated-events-button {
  text-transform: uppercase;
}

#undated-events {
  display: none;
  .event {
    background-color: $ic-color-light;
    line-height: $ic-line-height;
    padding: 0;
    border: none;
    .undated_event_title {
      color: inherit;
      @include fontSize(13px);
    }
  }
}
